package com.example.carproviderbackstage.service.impl.dl.admin;

import com.alibaba.dubbo.config.annotation.Service;
import com.example.carinterface.service.dl.admin.SettingService;
import com.example.carinterface.utils.ResultJson;
import com.example.carproviderbackstage.mapper.dl.admin.SettingMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

@Service
public class SettingServiceImpl implements SettingService {

    @Autowired
    private SettingMapper settingMapper;

    @Override
    public ResultJson<List<Map<String, Object>>> findAdmin(Map<String, Object> map) {

        ResultJson<List<Map<String, Object>>> resultJson = new ResultJson<>();
        List<Map<String,Object>> list =   settingMapper.findAdmin(map);

        resultJson.setSuccess("查询成功",list);

        return resultJson;
    }

    @Override
    public ResultJson<String> addAdmin(Map<String, Object> map) {

        ResultJson<String> resultJson = new ResultJson<>();



        int i =   settingMapper.addAdmin(map);
      if (i==1){
          resultJson.setSuccess("添加成功");
      }else {
          resultJson.setSuccess("添加失败");
      }


        return resultJson;
    }
}
